#include "RessourceStruct.h"

RessourceStruct::RessourceStruct()
{
	m_destroy = true;
}

bool RessourceStruct::isDestroy() const
{
	return m_destroy;
}

sf::Vector2f RessourceStruct::getPosition() const
{
	return m_skin.getPosition();
}

sf::Vector2f RessourceStruct::getBox() const
{
	return sf::Vector2f(m_skin.getGlobalBounds().width, m_skin.getLocalBounds().height);
}

int RessourceStruct::random(int a, int b)
{
    return rand()%(b-a) +a;
}

std::string RessourceStruct::getName() const
{
	return m_name;
}

void RessourceStruct::init(const sf::Vector2f position, ImgMgr *imageManager)
{
	m_skin.setPosition(position);
	m_destroy = false;
}

void RessourceStruct::maj(Level *level)
{
	if(m_vie <= 0)
		m_destroy = true;
}

void RessourceStruct::render(sf::RenderWindow *app)
{
	if(!m_destroy)
		app->draw(m_skin);
}

